//
//  FQDCyclePageView.h
//  FakeQDaily
//
//  Created by mewxiv on 8/13/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void (^SelectPageItemBlock)(NSInteger idx);

@class FQDCyclePageView;

@protocol FQDCyclePageViewDataSource <NSObject>
@required
// 轮播的页面数
- (NSInteger)numberOfPagesInPageView:(FQDCyclePageView *)pageView;
// 返回自定义轮播页面
- (UIView *)pageView:(FQDCyclePageView *)pageView viewForPageAtPageIndex:(NSInteger)pageIndex;

@end

// 页面轮播器
@interface FQDCyclePageView : UIView

// 页面数据源
@property (nonatomic, strong) id<FQDCyclePageViewDataSource>dataSource;
// 点击某一页的回调
@property (nonatomic, copy) SelectPageItemBlock selectPageItemBlock;
// 自动滚动时间间隔
@property (nonatomic, assign) NSTimeInterval autoCycleTime;

- (void)setSelectPageItemBlock:(SelectPageItemBlock)selectPageItemBlock;
// 重新加载数据
- (void)reloadData;
// 暂停自动轮播
- (void)pauseCycleScroll;
// 继续自动轮播
- (void)resumeCycleScroll;

@end
